package top.suven.base.http.enums;


import com.google.common.collect.Maps;

import java.util.Map;

/**
 * @Title: MsgEnumType.java
 * @author Joven.wang
 * @date 2015年2月10日
 * @version V1.0
 * @Description: TODO(说明) 此类封装了,从第三方平台的返回code,转换成业务逻辑用户错误提示信息; eg:
 *               SYS_CODE_为前缀,后缀编码为第三方反回code信息,括号为提前端编码和提示信息;
 */

public enum SysMsgEnumType implements IMsgEnumType {

	/** 编码规范说明: 1,1 01 001 错误编码的意思,第一位(1)代码是系统,第2位是功能码
	 第3，4位( eg: 01用户信息模块, 02礼物模块),第5，6，7号(该模块用到的返回提示用号的编码code)
	 1. 1 00 01 - 100 99(共99个系统级别) 是手端(看7.0 app 2.0) 应用后台系统级别返回来的统一规范编码
	 1.第1位表示软件平台：1
	 2.第2位表示功能类型：1.弹窗提示，2.软接连，3.跳转url
	 3.第3.4位表示模块分类名称：00系统 01 用户 02 验证 03 资源 04 支付 05 资产 06 设备 07 订单 08 活动 09 桌面 10 配置 11 MQ 12 定时 13 第三方 14 应用市场
	 4.第5，6，7位表示错误序列号；
	 */
	SYS_SUCCESS(0, "成功"),

	/** 系统返回错误码 10000~10099*/
	SYS_UNKOWNN_FAIL(1100000, "操作失败!"),
	SYS_TOKEN_NULL(1100001, "请重新登录"),
	SYS_INVALID_REQUEST(1100002,"无效请求"),
	SYS_PARAM_ERROR(1100003,"参数请求错误，%s！"),
	SYS_PARAM_CHECK(1100004,"参数检验不符要求！"),
	SYS_CUID_FORMAT_ERROR(1100005,"cuid不合法！"),
	SYS_PROJECT_MAINTAIN(1100006,"服务维护中！"),
	SYS_VISITS_WAIT(1100007,"当前访问人数过多，请稍后重试！"),

	SYS_WEB_UNKOWNN_FAIL(2100000, "操作失败!"),
	SYS_WEB_CHECK_INFO_FAIL(2100001, "请选择需要处理的记录"),
	SYS_WEB_UPD_INFO_NO_EXIST(2100002, "待操作的记录不能为空"),

	/**  用户模块(1101) **/
	USER_CODE_NOT(1101001,"账号不存在！"),
	USER_CODE_EXIT(1101002,"账号已存在！"),
	USER_REGISTER_FAIL(1101003,"注册通行证失败，请稍后再试！"),
	PAY_PASS_WORD_NOT_SAME(1101005,"2次付款密码不一致"),
	USER_SMS_CODE_FAILE(1101006,"无效的短信类型"),
	USER_SMS_GET_CODE_FAILE(1101007,"获取验证码失败，请稍后重试！"),
	USER_SMS_CODE_NOT_EXIT(1101008,"请先获取验证码"),
	USER_SMS_CODE_BE_INVALID(1101009,"取验证码无效"),
	USER_CODE_IS_FORBID_LOGIN(1101010,"您的帐号已被禁止登录系统，如有疑问，请联系我司客服"),
	USER_CODE_IS_BACK_LIST(1101011,"您的帐号目前处于黑名单状态，暂时不能登录"),
	USER_CODE_NICKNAME_LENGTH(1101012,"您的昵称太长了"),
	USER_PHONE_NOT_SAME(1101014,"手机号码原有邦定号码不一致"),
	USER_PHONE_NOT_NULL(1101015,"手机号码不能为空"),
	USER_PASSWORD_NOT_NULL(1101016,"密码不能为空"),
	USER_SMS_CODE_NOT_NULL(1101017,"密码不能为空"),
	USER_LOGIN_ALIAS_INOF_FAILE(1101018,"扩张登陆码失败"),
	USER_LOGIN_PASSWORD_FAILE(1101019,"密码错误，请重先输入"),
	USER_LOGIN_PASSWORD_LENGTH(1101020,"新密码长度不能低于6位"),
	USER_PASSWORD_MODIFY_FAIL(1101021,"修改密码失败"),
	USER_APP_ROLE_NOT_EXIT(1101022,"该软件没有注册权限，请联系管理员"),
	USER_APP_ROLE_NOT_LOGIN(1101023,"该用户没有权限不足，请联系管理员"),
	USER_APP_PHONE_NUM_FAIL(1101024,"当前使用的手机号格式错误，请检查！"),
	USER_PARTNER_ID_FAIL(1101025, "商户号错误，商户号以:“ %s “ 开头"),
	USER_UNIQUE_PRIMARY_KEY_FAIL(1101026, "AppId错误，appId以:“ %s “ 开头"),
	USER_PARTNER_CODE_NOT_EXIT(1101027, "该合作商户不存在"),
	USER_PARTNER_APP_NOT_EXIT(1101028, "该合作商户的APP号不存在"),
	USER_ADDRESS_NOT_EXIT(1101030,"用户地址不存在"),
	USER_ADDRESS_ADD_FAIL(1101031,"新增地址失败"),
	USER_ADDRESS_MODIFY_FAIL(1101032,"修改地址失败"),
	USER_ADDRESS_MODIFY_DEFAULT(1101033,"该地址已经是默认地址"),
	USER_ADDRESS_NOT_RIGHT(1101034,"该用户没有删除地址权限"),
	USER_ID_IS_ERROR(1101035,"用户id不存在"),
	USER_THIRD_LOGIN_PARM_IS_ERROR(1101037,"parm参数格式错误"),
	USER_THIRD_LOGIN_PADUNIQUE_IS_NULL(1101038,"设备唯一标识为空"),
	USER_THIRD_LOGIN_THIRDTYPE_IS_ERROR(1101039,"第三方登录的类型错误"),
	USER_THIRD_LOGIN_CLIENT_IS_ERROR(1101040,"客户端类型错误"),
	USER_THIRD_LOGIN_WEIXINCODE_IS_NULL(1101041,"微信授权码为空"),
	USER_THIRD_LOGIN_WEIXINLOGIN_IS_ERROR(1101042,"微信登录失败，请联系管理员"),
	USER_THIRD_LOGIN_WEIXINLOGIN_PARAMS_IS_NULL(1101043,"微博登录失败，参数为空"),
	USER_THIRD_LOGIN_WEIBOLOGIN_IS_ERROR(1101044,"微博登录失败，请联系管理员"),
	USER_THIRD_LOGIN_QQLOGIN_PARAMS_IS_NULL(1101045,"QQ登录失败，参数为空"),
	USER_THIRD_LOGIN_QQLOGIN_IS_ERROR(1101046,"QQ登录失败，请联系管理员"),
	USER_LOGIN_FAIL(1101047,"登录失败，请联系管理员"),
	USER_INFO_IS_NOT_FOUNT(1101048,"未找到用户资料"),
	USER_USERNAME_ERROR(1101049,"用户名错误！"),
	USER_MOBILEPHONE_EXISTS(1101050,"此号码已经被绑定了,请重新输入其他手机号码"),
	USER_INVITEECODE_ERROR(1101051,"邀请码不能在同一手机注册"),
	USER_BIND_TASE_PAD_ERROR(1101052,"用户申请体验设备状态和设备数量错误"),
    USER_BANK_CARD_NULL(1101053,"银行账号不能为空"),
    USER_BANK_NAME_NULL(1101054,"银行名称不能为空"),
    USER_BANK_USER_NAME_NULL(1101055,"开户人姓名不能为空"),
    USER_CONTACT_PHONE_NULL(1101056,"联系电话不能为空"),
    USER_SECURE_PWD_NULL(1101057,"安全口令不能为空"),
    USER_BIND_TASE_PADINFO_ERROR(1101058,"绑定失败,更新用户绑定信息失败"),
	USER_EMAIL_IS_NULL(1101059,"此邮箱没绑定账号"),
	USER_MOBILE_IS_NOT_REGISTERED(1101060,"此账号没有手机号码"),
	ALI_REALNAME_NULL(1101064,"未设置支付宝账号真实姓名"),

	/**  验证模块(1102) **/
    GAME_ORDE_CASH_IN_LOCKE(1102061,"订单已被玩家接单，来迟了"),
	AUTH_CLIENT_ILLEGAL(1102001,"客户端类型不正确"),
	AUTH_CLIENT_SECRET_ILLEGAL(1102002,"客户端密码不正确"),
	AUTH_ACCESS_TOKEN_FAIL(1102003,"ACCESS_TOKEN校验失败,请重新登陆!"),
	AUTH_GET_ACCESS_TOKEN_FAIL(1102004,"获取ACCESS_TOKEN失败"),
	AUTH_VALIDCODE_IS_NULL(1102005,"请输入图形验证码"),
	AUTH_VALIDCODE_IS_FAIL(1102006,"图形验证码失效，请重新获取"),
	AUTH_VALIDCODE_IS_ERROR(1102007,"图形验证码不正确，请重新输入"),
	AUTH_USER_LOGIN_USERNAME_IS_NULL(1102008,"用户账号为空"),
	AUTH_USER_CLASSIFY_IS_ERROR(1102012,"非工作室会员不能在工作室客户端登录"),
	AUTH_USER_CLASSIFY_IS_ERROR2(1102013,"无效账号，请联系客服"),//工作室会员不能在红手指客户端登录
	AUTH_USER_MOBILE_UNBIND_FAILED(1102014,"用户未绑定手机号码,请绑定手机号码"),
	AUTH_USERNAME_IS_DISABLE(1102015,"此用户已经被冻结,请联系管理员"),
	AUTH_LOGINTYPE_IS_ERROR(1102016,"登录类型错误"),
	AUTH_LOGIN_FAILD_IS_ERROR(1102018,"请重新登录！"),
	AUTH_UUID_IS_NULL(1102019,"uuid不能为空"),
	AUTH_PASSWORD_IS_ERROR(1102020,"密码不正确"),
	AUTH_CHANNEL_CODE_IS_ERROR(1102021,"渠道编码非法"),
	AUTH_SIGN_IS_NULL(1102022,"加密参数不能为空"),
	AUTH_PROJECT_NAME(1102023,"项目名字不存在"),
	AUTH_SIGNUP_SERVERCODE_ERROR(1102024,"验证码失效，请重新获取"),
	AUTH_SIGNUP_PWD_REQSTPWD_ERROR(1102025,"两次输入密码不一致"),
	AUTH_SIGNUP_MOBILECODE_ERROR(1102026,"验证码不正确，请重新输入"),
	AUTH_SIGNUP_MOBILEPHONE_ERROR(1102027,"请输入正确手机号码格式"),
	AUTH_SIGNUP_PWD_ERROR(1102028,"密码错误，密码须为8-20位字母和数字的组成"),
	AUTH_SIGNUP_MOBILE_ERROR(1102029,"验证参数错误，请重新注册"),
	AUTH_NO_PERMISSION(1102030,"当前客户端没有权限"),
	AUTH_PROBLEM_EXCEPTION(1102031,"AUTH校验参数失败"),
	AUTH_ACCESS_TOKEN_EXPIRE(1102032,"ACCESS_TOKEN校验过期,请重新刷新!"),

	/**  资源模块(1103)-分享部分 **/
	SHARE_NO_FOUND(1103001,"找不到分享信息"),
	PICTURE_MODULECODE_NOT_FOUND(1103002,"找不到图片模块"),
	RESOURCE_UPLOAD_UPPER_LIMIT(1103003,"本月用户同一台云手机上传超过规定次数"),
	RESOURCE_FILE_NAME_IS_FAIL(1103004,"上传文件格式错误"),
	RESOURCE_INSTALL_FILE_IS_NO_APK(1103005,"只支持自动安装apk类型的文件"),
	RESOURCE_UPLOAD_FILE_IS_FAIL(1103006,"文件上传失败，请联系管理员"),
	RESOURCE_SVIP_NOT_SUPPORT_RECHARGE(1103007,"超级VIP商品不支持充值"),
	RESOURCE_GOODS_NOT_EXIST(1103008,"您所购买的商品不存在"),
	RESOURCE_PURCHASED_EXPERIENCE_GOODS(1103009,"您已经购买体验价格商品"),
	RESOURCE_SMS_TOO_MUCH_OF_DAY(1103010,"此手机最近24小时发送短信过多"),
	RESOURCE_SMS_TOO_MUCH_OF_SECOND(1103011,"请休息下，不要重复发送验证码"),
	RESOURCE_SMS_TOO_MUCH_OF_IP(1103012,"您发送短信过多,休息下吧"),
	RESOURCE_SEND_SMS_FAIL(1103013,"短信发送失败，请联系管理员"),
	RESOURCE_VALID_CODE_ERROR(1103014,"图形验证码错误，请重新输入"),
	RESOURCE_VALID_CODE_EXPIRE(1103015,"图形验证码失效，请重新获取"),
	RESOURCE_MOBILE_IS_REGISTERED(1103016,"此手机号码已经被注册，请重新输入手机号码"),
    RESOURCE_MAC_ID_FORMAT_ERROR(1103017,"MACID格式有误"),
    RESOURCE_IMEI_FORMAT_ERROR(1103018,"IMEI格式有误"),
    RESOURCE_MOBILE_IS_BIND(1103019,"该手机号码已被其他账号认证绑定，请更换号码"),
    RESOURCE_MOBILE_IS_NOT_REGISTERED(1103020,"手机号码未注册，请确认手机号码"),
	RESOURCE_SEND_VOICE_FAIL(1103021,"语音验证码发送失败，请联系管理员"),
	RESOURCE_SEND_SMS_TOO_MUCH(1103022,"发送短信的次数过多，请%s后再试!"),

	/**  支付模块(1104)**/

	/**  资产模块(1105)**/
	ASSETS_COUPONTYPEID_IS_ERROR(1105001,"优惠卷类型找不到对应的优惠卷"),
	ASSETS_COUPON_IS_NO_GOODS(1105002,"优惠卷没有关联产品"),
	ASSETS_ACTIVATIONCODE_IS_OVER(1105003,"激活码已发放完，请联系客服"),
	ASSETS_COUPON_IS_OVER(1105004,"优惠券已发放完，请联系客服"),
	ASSETS_COUPON_BIND_ERROR(1105005,"绑定优惠券失败,请联系客服"),

	/**  设备模块(1106) **/
	PAD_ONE_USER_ONE_TIME(1106001,"每个用户只能申请一次体验云手机"),
	PAD_NOT_ENOUGH(1106002,"当前体验云手机已被抢光，建议购买VIP"),
	PAD_HAD_ONE(1106003,"获取过云手机不能申请体验云手机"),
    PAD_CODE_IS_ERROR(1106004,"设备编码不存在"),
    PAD_ID_USER_ID_IS_ERROR(1106005,"用户设备不存在"),
	PAD_SCREEN_NOT_ALLOW(1106006,"非VIP云手机和体验云手机不提供截屏功能"),
	PAD_SAVE_USER_PAD_ERROR(1106007,"保存用户设备失败"),
	PAD_SAVE_LOG_USER_PAD_ERROR(1106008,"保存用户设备日志失败"),
	PAD_SAVE_LOG_PAD_ERROR(1106009,"保存用户设备失败"),
	PAD_UPDATE_PAD_ERROR(1106010,"修改设备信息失败"),
	PAD_CODE_IS_NULL(1106011,"设备编码为空"),
	PAD_IS_AUTO_BINDTASTE(1106012,"第一次登录自动绑定体验设备开关未开启"),
	PAD_BINDTASTE_NO(1106013,"该用户无权限申请体验设备"),
	PAD_BINDTASTE_NO_CUID_IP(1106014,"该ip或者cuid已经超出申请限额"),
	PAD_BINDTASTE_CONTROLTIME_ERROR(1106015,"绑定失败,查询控制时间配置信息失败"),
	PAD_BINDTASE_PAD_ERROR(1106016,"绑定失败,保存用户设备绑定信息失败"),
	PAD_BINDTASE_FACILITY_ERROR(1106017,"查询失败,设备来源被禁用或者为空"),
	PAD_NAME_NOT_CHANGE(1106018,"名称无改动"),
	PAD_NAME_HAS_SENSITIVE(1106019,"云手机名称不能含有敏感字和特殊字符"),
	PAD_NO_ACCESS_PERMISSION(1106020,"设备没有访问权限"),
	PAD_USER_NOT_BIND(1106021,"用户未绑定此云手机"),
	PAD_LACK(1106022,"云手机不足"),
	PAD_BIND_MAX(1106023,"用户绑定数量达到上限"),
	PAD_USER_INSUFFICIENT(1106024,"云手机不足，请联系管理员耐心等待"),
	PAD_ONE_USER_ONE_FREE(1106025,"每个用户现只能申请一次普通云手机"),
	PAD_ILLEGAL_CHANNELS(1106026,"渠道非法"),
	PAD_TIME_NO_PAD(1106027,"该时段已无云手机，整点开放申请"),
	PAD_NOT_SUPPORT_RECHARGE(1106028,"该云手机不支持充值"),
    PAD_IS_EXPIRE(1106029,"云手机已过期"),
    PAD_BINDTASE_REG_LIMIT_ERROR(1106030,"用户已注册超过%s，体验活动已过期"),
	PAD_CONFIG_ERROR(1106031,"配置信息有误,请检查配置信息"),
	PAD_CHECK_IDC_ERROR(1106032,"查询失败,设备IDC被禁用或者为空"),
    PAD_BINDTPAD_GRANTCODE_EXPIRE_ERROR(1106033,"错误次数过多，请%s后再试"),
    PAD_BINDTPAD_VALIDCODE_IS_NULL(1106034,"请输入图形验证码"),
    PAD_BINDTPAD_GRANTCODE_IS_EXPIRE(1106035,"授权码已失效"),
    PAD_BINDTPAD_GRANTCODE_IS_MYSELFT(1106036,"不能绑定自己授权的云手机"),
    PAD_BINDTPAD_GRANTCODE_NO_PAD(1106037,"云手机不存在"),
    PAD_BINDTPAD_GRANTCODE_NO_VIP(1106038,"非VIP云手机不能绑定"),
    PAD_BINDTPAD_GRANTCODE_PAD_ERROR(1106039,"云手机状态异常不能进行授权"),
    PAD_BINDTPAD_GRANTCODE_PAD_EXPIRE(1106040,"云手机已过期,不能进行授权"),
    PAD_BINDTPAD_GRANTCODE_ERROR_CLASSIFY(1106041,"授权失败，只能同类型用户间授权"),
    PAD_BINDTPAD_GRANTCODE_BINDED(1106042,"该用户已经被授权该云手机，不能重复绑定云手机"),
    PAD_BINDTPAD_GRANTCODE_BIND_MAX(1106043,"每个用户最多被授权%s台云手机，不能继续绑定云手机"),
    PAD_BINDTPAD_GRANTCODE_BIND_ERROR(1106044,"绑定授权云手机失败"),
    PAD_BINDTPAD_GRANTCODE_NOPHONE_ERROR(1106045,"没有绑定手机，不允许使用授权码"),
    PAD_GRANTETYPE_IS_ERROR(1106046,"授权类型错误"),
	PAD_ONE_USER_ONE_GAME(1106047,"您已经有申请过的游戏云手机,不能再申请"),



    /**  订单模块(1107) **/
	ORDER_FAILED(1107001,"下单失败，请联系管理员"),
	ORDER_ALREADY_BUY_VIP(1107002,"您已购买过超级VIP商品"),
	ORDER_TOO_FREQUENT(1107003,"订单提交太频繁"),
	ORDER_IS_NULL(1107004,"订单不存在"),

	/**  活动模块(1108) **/
	ACTIVITY_COUPONTYPEID_IS_ERROR(1108001,"优惠卷类型找不到对应的优惠卷"),
	ACTIVITY_COUPON_IS_NO_GOODS(1108002,"优惠卷没有关联产品"),
	ACTIVITY_TASK_IS_ERROR(1108003,"此任务不存在或已失效"),
	ACTIVITY_TASK_GET_ERROR(1108004,"您领取该任务失败"),
	ACTIVITY_TASK_NO_GET(1108005,"您未领取该任务"),
	ACTIVITY_TASK_OVER_TODAY(1108006,"您今日已完成该任务"),
	ACTIVITY_TASK_OVER(1108007,"您已完成该任务"),
	ACTIVITY_TASK_GET_DUBBO(1108008,"任务重复领取"),
	ACTIVITY_TASK_FINISH_ERROR(1108009,"完成该任务失败,更新用户任务异常"),
	ACTIVITY_TASK_RECEIVE_AWARD(1108010,"已领取过任务奖励,不能重复领取"),
	ACTIVITY_TASK_AWARD_ERROR(1108011,"当前奖励已失效,请重新完成任务"),
	ACTIVITY_TASK_RECEIVE_AWARD_ERROR(1108012,"领取奖励失败"),
	ACTIVITY_IS_OVER(1108013,"活动已结束，请关注下次活动时间"),
	ACTIVITY_NOT_GOODS(1108014,"套餐已经被抢购一空，请关注下次活动时间"),
	ACTIVITY_INVITECODE_ERROR(1108015,"邀请码错误"),
	ACTIVITY_PASS_INTERFACE_LIST(1108016,"非法请求接口"),
	ACTIVITY_TASK_NOFINISH_RECEIVE_AWARD_ERROR(1108017,"任务未完成,无法领取奖励"),
	ACTIVITY_TASK_EVERYDAY_RECEIVE_AWARD_ERROR(1108018,"领取奖励失败,每日任务只能领取当日奖励"),



	/**  桌面模块(1109) **/

	/**  配置模块(1110) **/

	/**  MQ模块(1111) **/
	MQ_ROCKET_CONFIG_IS_NULL(1111001,"系统引入ROCKET_MQ但未配置相关信息"),
	MQ_ROCKET_CONSUMER_GROUPNAME_IS_NULL(1111002,"ROCKET_MQ的消费者分组名字配置不能为空"),
	MQ_ROCKET_TOPIC_NAME_IS_NULL(1111003,"ROCKET_MQ的TOPIC名字不能为空"),
	MQ_ROCKET_TAG_IS_NULL(1111004,"ROCKET_MQ的名字不能为空"),
	MQ_ROCKET_ADDRESS_IS_NULL(1111005,"ROCKET_MQ的服务器地址不能为空"),
	MQ_ROCKET_PRODUCER_GROUPNAME_IS_NULL(1111006,"ROCKET_MQ的生产者分组名字配置不能为空"),
	MQ_ROCKET_PRODUCER_SEND_ERROR(1111007,"ROCKET_MQ消息发送失败"),
	MQ_ROCKET_PRODUCER_NOT_FOUND(1111008,"ROCKET_MQ的生产者配置未找到"),
	MQ_ROCKET_TOPIC_NOT_FOUND(1111009,"ROCKET_MQ的TOPIC未找到"),
	MQ_ROCKET_TOPIC_SEND_ERROR(1111010,"消息发送失败"),

	/**  定时模块(1112) **/

	/**  第三方模块(1113) **/

	/**  应用市场模块(1114) **/
	MARKET_PARAM_CHANNEL_VERSION_FAIL(1142002,"渠道版本非法"),
	MARKET_VERSION_TOO_LOW(1142003,"当前版本过低，请去官网下载最新版本"),
	MARKETVERSION_IS_LOW(1142004,"版本更新"),
	MARKET_PARAM_CHANNEL_VERSION_LOW(1142005,"渠道版本太低"),

	;

	private int code;
	private String msg;
	private static Map<String, IMsgEnumType> msgTypeMap = Maps.newHashMap();
	private static Map<Object, Integer> checkTypeMap = Maps.newHashMap();
	static {
		for(SysMsgEnumType msgType : values()) {
			msgTypeMap.put(msgType.name(), msgType);
			if(null != checkTypeMap.get(msgType.getCode())){
				throw new RuntimeException(" SysMsgEnumType is type double :" +msgType.getCode()+" and "+ msgType.getMsg() +"is exist ");
			}
			checkTypeMap.put(msgType.getCode(), 0);
		}
		checkTypeMap = null;
	}

	SysMsgEnumType(int code,String msg) {
		this.code = code;
		this.msg = msg;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public SysMsgEnumType setMsg(String msg){
		this.msg = msg;
		return this;
	}

	public String getProject() {
		return null;
	}

}
